<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">  
    <title>商品搜索</title>
    <link rel="stylesheet" href="/Public/Home/css/search.css">
    <!--不识别数字为手机-->
<meta name="format-detection" content="telephone=no, email=no"/>
<!--通用js-->
<?php if(isset($signPackage) && !empty($signPackage)){ ?>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js?v=201704270010"></script>
<?php } ?>
<script type="text/javascript" src="/Public/Home/js/require.js"></script>
<script type="text/javascript" src="/Public/Home/js/baseLoading.js?v=201705240001"></script>
<script src="/Public/Home/js/jquery.min.js" ></script>
<script src="/Public/Home/js/pincode-input.js" ></script>
<script src="/Public/Home/js/parabola.js" ></script>
<script src="/Public/Home/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
    _global.isLogin = !!"<?php echo $wx_member_id; ?>";
	var isWxShareDiy = typeof yc_share_diy === "undefined" ? false : yc_share_diy;
	var yc_wx_shareImgPath = "";
	<?php if(isset($weixin_logo) && !empty($weixin_logo)){ ?>
		yc_wx_shareImgPath = "/Uploads/<?php echo ($weixin_logo["image"]); ?>";
	<?php } ?>
    var yc_pass_arr = {'local_id':"<?php echo I('local_id',1);?>",'top_local_id':"<?php echo I('top_local_id',1);?>"};
	if(parseInt(yc_pass_arr["local_id"]) == 21){
		_global.isStopSell = true;
	}
    <?php if(isset($signPackage) && !empty($signPackage)){ ?>
        _global.isWeiXinLoad = true;
        var isEnableLocation = typeof yc_wx_location === "undefined" ? false : yc_wx_location;
        var yc_wx_options = {
            "enableLocation" : isEnableLocation,
            "refuseCallback" : function(){},
            "mapCallback" : function(){},
            "config" : {
                debug: false,
                appId: '<?php echo $signPackage["appId"];?>',
                timestamp: '<?php echo $signPackage["timestamp"];?>',
                nonceStr: '<?php echo $signPackage["nonceStr"];?>',
                signature: '<?php echo $signPackage["signature"];?>',
                jsApiList: [
                    'checkJsApi'
                ]
            }
        };
        var isInHeader = typeof yc_wx_useInHeader === "undefined" ? true : yc_wx_useInHeader;
        if(isInHeader){
            wxAutoConfig(yc_wx_options);
        }
    <?php } ?>
</script>
</head>
<body>
    <div class="warp">
        <div class="search">
            <div class="search-bar">
                <form action="<?php echo U('',['local_id'=>$_GET['local_id'] ?: 1], '');?>" method="get"  onSubmit="return checkSearch();">
                    <a href="javascript:void(0)" onclick="window.history.back();" class="back">取消</a>
                    <p class="input-box">
                        <input type="search" placeholder="请输入商品名称" name="keywords" value="<?php echo ($keywords); ?>">
                        <a href="javascript:void(0);" class="value-delete"></a>
                    </p>
                </form>
            </div>
            <?php if(!empty($hot_search)) { ?>

            <!--<?php if($hot_search != ''): ?>-->
                <div class="search-hot">
                    <h3>热门搜索</h3>
                    <div class="hot-key">
                        <?php if(is_array($hot_search)): $i = 0; $__LIST__ = $hot_search;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><a href="<?php echo U('',['local_id'=>$_GET['local_id'] ?: 1,'hotKey'=>$vo['id']], '');?>?keywords=<?php echo ($vo["name"]); ?>" data-id="<?php echo ($vo["id"]); ?>"><?php echo ($vo["name"]); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
                    </div>
                </div>
            <!--<?php endif; ?>-->
            <?php } ?>
            <div id="search-history-box" class="search-history">
                <h3>历史搜索<a href="javascript:void(0);" class="delete-history"></a></h3>
                <div id="search-history-list" class="history-list"></div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
		loadSearchRecords();
		require(['search']);
	</script>
</body>
</html>